<template>
  <div>
    <vxe-table :data="tableData" :loading="loading" 
    show-overflow
    border
    height="400"
    :row-config="{isHover: true}"
    :scroll-y="{enabled: true}"
    >
      <vxe-column field="id" title="序 ID" width="60"></vxe-column>
      <vxe-column field="name" title="名字"></vxe-column>
      <vxe-column field="value" title="对应值"></vxe-column>
    </vxe-table>
  </div>
</template>

<script setup>
import { ref, onMounted } from "vue";
import axios from 'axios';

const tableData = ref([]);
const loading = ref(false);

onMounted(() => {
  init();
});

const init = async () => {
  loading.value = true;
  const { data } = await axios.get("/api/getList");
  loading.value = false;
  tableData.value = data.data;
};
</script>
